package com.cai.mvvm.api;

import com.google.gson.Gson;
import com.mvvm.library.base.BaseBean;
import io.reactivex.Observable;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;

/**
 * @创建时间：2023/2/23
 * @作者：小蔡
 * @功能介绍：
 */
@SuppressWarnings("ALL")
public interface Api {
    //登录
    @POST("services/UserFact/login")
    Observable<BaseBean<Object>> login(@Body RequestBody body);

    @GET("download/pda/wmsurl.json")
    Observable<Object> getWmsUrl();
    //将map 集合转为需要的json 数据上传
    public static RequestBody postRawObj(Object object) {
        return RequestBody.create(MediaType.parse("application/json;charset=UTF8"), new Gson().toJson(object));
    }

}
